﻿using System;
using System.Collections.Generic;
using BCCommon;
using BCCommon.Enums;
using BCDto.Common.Wallet;
using BCDto.Website.User;
using BCDto.Common.FlowRecord;
using BCCommon.PaymentEnums;

namespace BCService.Common.Wallet
{
    public interface IWalletTransferService
    {
        /// <summary>
        /// 获取单条提现记录信息
        /// </summary>
        /// <param name="id">申请记录id</param>
        /// <returns></returns>
        WalletTransferDto Get(long id);

        /// <summary>
        /// 同意提现申请
        /// </summary>
        /// <param name="id">申请记录id</param>
        /// <param name="userDto"></param>
        /// <returns></returns>
        WalletTransferDto Approve(long id, UserDto userDto);

        /// <summary>
        /// 转账确认
        /// </summary>
        /// <param name="id">申请记录id</param>
        /// <param name="amount">转账金额</param>
        /// <param name="ip">登录IP</param>
        /// <returns></returns>
        WalletTransferDto TransferConfirm(long id, decimal amount, string ip);

        /// <summary>
        /// 拒绝提现申请
        /// </summary>
        /// <param name="id">申请记录id</param>
        /// <param name="dto">提现驳回</param>
        /// <returns></returns>
        WalletTransferDto Reject(long id, WalletTransferRejectRequestDto dto);

        /// <summary>
        /// 创建申请
        /// </summary>
        /// <param name="requestDto">提现请求</param>
        /// <param name="userDto">用户信息</param>
        /// <returns></returns>
        WalletTransferDto Create(WalletTransferRequestDto requestDto, UserDto userDto);

        /// <summary>
        /// 用户提现列表
        /// </summary>
        /// <param name="userId">用户id</param>
        /// <param name="index">起始页</param>
        /// <param name="size">页数量</param>
        /// <returns></returns>
        PageableList<WalletTransferDto> GetUserWalletTransfer(long userId, int index, int size);

        /// <summary>
        /// 提现条件分页列表
        /// </summary>
        /// <param name="pageIndex">起始页</param>
        /// <param name="pageSize">页数量</param>
        /// <param name="status">提现状态</param>
        /// <param name="appType">应用类型</param>
        /// <param name="userName">用户名</param>
        /// <param name="ascending">排序</param>
        /// <param name="phone">手机号</param>
        /// <returns></returns>
        PageableList<WalletTransferDto> Get(int pageIndex, int pageSize, CashOutStatusType? status, SourceAppType? appType, string userName, bool? ascending = null, string phone = null);

        /// <summary>
        /// 查看指定用户的账单明细
        /// </summary>
        /// <param name="pageIndex">分页页码</param>
        /// <param name="pageSize">分页页数</param>
        /// <param name="userId">用户编号</param>
        /// <param name="ascending">排序</param>
        /// <returns></returns>
        PageableList<UserFlowRecordDto> GetBillingDetailsByUserId(long? userId, bool? ascending, int pageIndex, int pageSize);
    }
}